**********REPLICATION SYNTAX FOR **********
*Engelhardt, Andrew M. & Cindy D. Kam. A Racial Reckoning? Racial Attitudes in the Wake of the Murder of George Floyd*
**********PSRM**********
*Nationscape data source: https://www.voterstudygroup.org/downloads/nationscape?key=456752
log using "Nationscape_PSRM2.log"
cd "C:\Users\kamcd\Dropbox\CDK WORK\BLM IAT paper\Writing\PSRM\Final Submission\Replication Files\3_Nationscape"

clear
set max_memory 2g
set more off
set scheme s1mono

*****START OF DATA CLEANING*****
use "phase2and3combined"
gen dateofIW = dofC(start_date)
gen yearofIW = year(dateofIW)
gen weekofIW = week(dateofIW)
gen monthofIW = month(dateofIW)
tab weekofIW if dateofIW==22060
tab dateofIW if weekofIW==21
drop if yearofIW==2021
egen newweekofIW = cut(dateofIW), at(21914(7)22279)
egen newweekofIW2 = group(newweekofIW)
replace newweekofIW2 = 52 if dateofIW==22278|dateofIW==22279
lab var newweekofIW2 "Numbered week of the year, with post GF=22"
lab val newweekofIW2 newweekofIW2 
recode newweekofIW2 (0/21=0)(22/52=1 "Post")(else=.), gen(weekspostGF)

recode newweekofIW2(0/21=0 "Pre GF")(22/52=1 "Post GF")(else=.), gen(prepost)
lab var prepost "Post GF, May 26 2020-Dec 31 2020"

*Create dummies for new week variables
forval v = 1/52 {
recode newweekofIW2 (`v'=1)(else=0), gen(week`v')
lab var week`v' "Week `v'"
}

**********KEY OUTCOME VARIABLE**********
*FAVORABILITY TOWARDS WHITES RELATIVE TO BLACKS
recode group_favorability_blacks (1=1 "very favorable")(2=.75)(3=.25)(4=0)(999=.5)(else=.), gen(favor_B)
recode group_favorability_blacks (1 2=1 "favorable")(3 4 999=0)(else=.), gen(favor_B_2cat)
recode group_favorability_whites (1=1 "very favorable")(2=.75)(3=.25)(4=0)(999=.5)(else=.), gen(favor_W)
recode group_favorability_whites (1 2=1 "favorable")(3 4 999=0)(else=.), gen(favor_W_2cat)
gen favorWoverB = (favor_W-favor_B)

preserve
svyset [pw=weight]
collapse favorWoverB  [pw=weight], by(newweekofIW2)
twoway (scatter favorWoverB  newweekofIW2, mcolor(black)) ///
(lowess favorWoverB  newweekofIW2 if newweekofIW2<22, lcolor(black)) ///
(lowess favorWoverB  newweekofIW2 if newweekofIW2>21, lcolor(black)) , ///
xtitle("Week Number in the Year") ytitle("Favorability towards Whites over Blacks") title("Full Sample") ///
legend(off) ylabel(-.2(.1).2) xline(22, lcolor(red)) xlabel(1(4)49) name(favor_B_byweek, replace)
restore

//placebo breakpoints
*Weekly data
preserve
svyset [pw=weight]
collapse favorWoverB [pw=weight], by(newweekofIW2)
forval v=14(2)30 {
twoway (lowess favorWoverB newweekofIW2 if newweekofIW2<`v', lcolor(black)) ///
(lowess favorWoverB newweekofIW2 if newweekofIW2>`v'-1, lcolor(black)) , ///
xlabel(1(4)52, val alternate labsize(small)) xtitle(" ") ytitle("Favorability towards Whites over Blacks") title("Breakpoint week `v'") ///
legend(off) note("Lowess smoothing") ylabel(-.1(.05).1) xline(22, lcolor(red)) text(.1 22 "-Murder of George Floyd", color(red) place(e)) name(Breakweek`v', replace)
}
restore

*Daily data
gen graphdate = dateofIW
format graphdate %tdMon_dd
preserve
svyset [pw=weight]
collapse favorWoverB [pw=weight], by(graphdate)
drop if graphdate==22139
//removing 22139 b/c there is only one observation on this date
twoway (bar favorWoverB graphdate, fcolor(white) lcolor(gray)) ///
(lowess favorWoverB graphdate if graphdate<22062, lcolor(black)) ///
(lowess favorWoverB graphdate if graphdate>22061, lcolor(black)) , ///
xlabel(21922(14)22279, alternate labsize(tiny)) xtitle(" ") ytitle("Favorability towards Whites over Blacks") title("Nationscape, 2020") ///
legend(off) note("Lowess smoothing") ylabel(-.05(.05).05) xline(22, lcolor(red)) name(daily, replace)
//22060 is date of murder
//22061 is date we are using as breakpoint
forval v=22054(2)22070 {
twoway (lowess favorWoverB graphdate if graphdate <`v', lcolor(black)) ///
(lowess favorWoverB graphdate if graphdate >`v'-1, lcolor(black)) , ///
 xlabel(21922(14)22279, alternate labsize(small)) xtitle(" ") ytitle("Favorability towards Whites over Blacks") title("Breakpoint Day `v'") ///
 legend(off) note("Lowess smoothing") ylabel(-.05(.05).05) xline(22061, lcolor(red)) xline(`v', lcolor(black) lpattern(dash)) ///
 text(.03 `v' "-Placebo Break Point", color(black) place(e)) text(.05 22061 "-Day After Murder of George Floyd", color(red) place(e)) name("Break`v'", replace)
}
restore

*BY RACE
gen White = .
replace White =1 if race_ethnicity ==1
gen Black= .
replace Black=1 if race_ethnicity ==2
gen BlackW=Black
replace BlackW=0 if White==1

preserve
svyset [pw=weight]
collapse favorWoverB [pw=weight], by(newweekofIW2 BlackW)
twoway (scatter favorWoverB newweekofIW2 if BlackW==1, mcolor(black)) ///
(lowess favorWoverB newweekofIW2 if newweekofIW2<22 & BlackW==1, lcolor(black)) ///
(lowess favorWoverB newweekofIW2 if newweekofIW2>21 & BlackW==1, lcolor(black)) , ///
xtitle("Week Number in the Year") ytitle("Favorability towards Whites over Blacks") title("Blacks") ///
legend(off) ylabel(-.2(.1).2) xline(22, lcolor(red)) xlabel(1(4)49) name(favor_B_byweekB, replace)

twoway (scatter favorWoverB newweekofIW2 if BlackW==0, mcolor(black)) ///
(lowess favorWoverB newweekofIW2 if newweekofIW2<22 & BlackW==0, lcolor(black)) ///
(lowess favorWoverB newweekofIW2 if newweekofIW2>21 & BlackW==0, lcolor(black)) , ///
xtitle("Week Number in the Year") ytitle("Favorability towards Whites over Blacks") ///
title("Whites") legend(off) name(favor_B_byweekW, replace) ///
xline(22, lcolor(red)) ylabel(-.2(.1).2) xlabel(1(4)49) 
restore

//by party among Whites
recode pid7_l (1 2 3=1 "Dem")(4=0 "Ind")(5 6 7=-1 "GOP")(else=.), gen(pid3cat)
gen WDem = .
replace WDem = 1 if pid3cat==1 & White==1
gen WGOP = .
replace WGOP = 1 if pid3cat==-1 & White==1
gen WInd = .
replace WInd = 1 if pid3cat==0 & White==1

preserve
svyset [pw=weight]
collapse favorWoverB [pw=weight] if White==1, by(newweekofIW2 pid3cat)
twoway (scatter favorWoverB newweekofIW2 if pid3cat==1, mcolor(black)) ///
(lowess favorWoverB newweekofIW2 if newweekofIW2<22 & pid3cat==1, lcolor(blue)) ///
(lowess favorWoverB newweekofIW2 if newweekofIW2>21 & pid3cat==1, lcolor(blue)) , ///
xtitle("Week Number in the Year") ytitle("Favorability towards Whites over Blacks") ///
title("White Democrats") legend(off) name(favor_B_byweekWD, replace) ///
xline(22, lcolor(red)) ylabel(-.2(.1).2) xlabel(1(4)49) 

twoway (scatter favorWoverB newweekofIW2 if pid3cat==0, mcolor(black)) ///
(lowess favorWoverB newweekofIW2 if newweekofIW2<22 & pid3cat==0, lcolor(black)) ///
(lowess favorWoverB newweekofIW2 if newweekofIW2>21 & pid3cat==0, lcolor(black)) , ///
xtitle("Week Number in the Year") ytitle("Favorability towards Whites over Blacks") ///
title("White Independents") legend(off) name(favor_B_byweekWI, replace) ///
xline(22, lcolor(red)) ylabel(-.2(.1).2) xlabel(1(4)49) 

twoway (scatter favorWoverB newweekofIW2 if pid3cat==-1, mcolor(black)) ///
(lowess favorWoverB newweekofIW2 if newweekofIW2<22 & pid3cat==-1, lcolor(red)) ///
(lowess favorWoverB newweekofIW2 if newweekofIW2>21 & pid3cat==-1, lcolor(red)) , ///
xtitle("Week Number in the Year") ytitle("Favorability towards Whites over Blacks") ///
title("White Republicans") legend(off) name(favor_B_byweekWR, replace) ///
xline(22, lcolor(red)) ylabel(-.2(.1).2) xlabel(1(4)49) 
restore

*****STATISTICAL TESTS
svyset [pw=weight]
svy: reg favorWoverB prepost
est store prepost
svy: reg favorWoverB week22-week52
est store postweekly
est table prepost postweekly, b(%9.2f) star(.1 .05 .01) stats(N)
coefplot prepost postweekly, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") ylabel(, labsize(vsmall)) title("Full Sample") name(weekly, replace) xlabel(-.2(.1).1)

//by racial group
svyset [pw=weight]
svy, subpop(White): reg favorWoverB prepost
est store prepostW
svy, subpop(White): reg favorWoverB week22-week52
est store postweeklyW
svy, subpop(Black): reg favorWoverB prepost
est store prepostB
svy, subpop(Black): reg favorWoverB week22-week52
est store postweeklyB
est table prepostW postweeklyW prepostB postweeklyB,  b(%9.2f) star(.1 .05 .01) stats(N) style(col) 
coefplot prepostW postweeklyW, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") ylabel(, labsize(vsmall)) title("Whites") name(weeklyW, replace) xlabel(-.2(.1).1)
coefplot prepostB postweeklyB, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") ylabel(, labsize(vsmall)) title("Blacks") name(weeklyB, replace) xlabel(-.2(.1).1)
suest postweeklyW postweeklyB
test [postweeklyW]week23=[postweeklyB]week23

suest prepostW prepostB
test [prepostW]prepost=[prepostB]prepost

//by party among Whites
svy, subpop(WDem): reg favorWoverB prepost
est store prepostWD
svy, subpop(WDem): reg favorWoverB week22-week52
est store postweeklyWD
svy, subpop(WInd): reg favorWoverB prepost
est store prepostWI
svy, subpop(WInd): reg favorWoverB week22-week52
est store postweeklyWI
svy, subpop(WGOP): reg favorWoverB prepost
est store prepostWR
svy, subpop(WGOP): reg favorWoverB week22-week52
est store postweeklyWR
est table prepostWD postweeklyWD prepostWI postweeklyWI prepostWR postweeklyWR, b(%9.2f) star(.1 .05 .01) stats(N) style(col)

suest prepostWD prepostWR
test [prepostWD]prepost=[prepostWR]prepost

coefplot prepostWD postweeklyWD , xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Democrats") name(WD_temporal, replace)  ylabel(, labsize(vsmall)) xlabel(-.2(.1).1)
coefplot prepostWI postweeklyWI, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Independents") name(WI_temporal, replace)  ylabel(, labsize(vsmall))  xlabel(-.2(.1).1)
coefplot prepostWR postweeklyWR, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Republicans") name(WR_temporal, replace)  ylabel(, labsize(vsmall)) xlabel(-.2(.1).1)

**********FIGURE 3 IN MANUSCRIPT**********
graph combine favor_B_byweek favor_B_byweekW favor_B_byweekB favor_B_byweekWR favor_B_byweekWI favor_B_byweekWD , ycommon common note("Lowess smoothing. Nationscape 2020") row(2) altshrink 
graph export Fig3.tif, replace

/*APPENDIX FIGURE A5*/
graph combine weekly weeklyW weeklyB WR_temporal WI_temporal WD_temporal , ycommon common row(2) altshrink 
graph export FigA5.tif, replace

/*APPENDIX FIGURE A6*/
graph combine Breakweek14 Breakweek16 Breakweek18 Breakweek20 Breakweek22 Breakweek24 Breakweek26 Breakweek28 Breakweek30, row(3) altshrink name(weeklyplacebo, replace)
graph export FigA6.tif, replace

/*APPENDIX FIGURE A7*/
graph display daily 
graph export FigA7.tif, replace 

/*APPENDIX FIGURE A8*/
graph combine Break22054 Break22056 Break22058 Break22060 Break22062 Break22064 Break22066 Break22068 Break22070, row(3) altshrink name(breakdaily, replace)
graph export FigA7.tif, replace


*OTHER RACIAL ATTITUDE MEASURES
*DISCRIMINATION AGAINST BLACKS
recode discrimination_blacks (1=1 "a great deal")(2=.75)(3=.5)(4=.25)(5=0 "None at all")(else=.), gen(discrim_B)

preserve
svyset [pw=weight]
collapse discrim_B[pw=weight], by(newweekofIW2)
twoway (bar discrim_B newweekofIW2, fcolor(white)) ///
(lowess discrim_B newweekofIW2 if newweekofIW2<22, lcolor(black)) ///
(lowess discrim_B newweekofIW2 if newweekofIW2>21, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ") ytitle("Amount of Discrimination Against Blacks") title("Full Sample") ///
legend(off) ylabel(.4(.1).8) xline(22, lcolor(red)) name(discrim_B_byweek, replace)
restore

preserve
svyset [pw=weight]
collapse discrim_B [pw=weight], by(newweekofIW2 BlackW)
twoway (bar discrim_B newweekofIW2 if BlackW==1, fcolor(none)) ///
(lowess discrim_B newweekofIW2 if newweekofIW2<22 & BlackW==1, lcolor(black)) ///
(lowess discrim_B newweekofIW2 if newweekofIW2>21 & BlackW==1, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ") ytitle("Amount of Discrimination Against Blacks") ///
text(.9 22 "-Murder of George Floyd", color(red) place(e)) ///
title("Blacks") legend(off) name(discrim_B_byweekB, replace) ///
xline(22, lcolor(red)) ylabel(.4(.1).8) 

twoway (bar discrim_B newweekofIW2 if BlackW==0, fcolor(none)) ///
(lowess discrim_B newweekofIW2 if newweekofIW2<22 & BlackW==0, lcolor(black)) ///
(lowess discrim_B newweekofIW2 if newweekofIW2>21 & BlackW==0, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ") ytitle("Amount of Discrimination Against Blacks") ///
title("Whites") legend(off) name(discrim_B_byweekW, replace) ///
xline(22, lcolor(red)) ylabel(.4(.1).8) 
restore

preserve
svyset [pw=weight]
collapse discrim_B [pw=weight] if White==1, by(newweekofIW2 pid3cat)
twoway (bar discrim_B newweekofIW2 if pid3cat==1, fcolor(none)) ///
(lowess discrim_B newweekofIW2 if newweekofIW2<22 & pid3cat==1, lcolor(blue)) ///
(lowess discrim_B newweekofIW2 if newweekofIW2>21 & pid3cat==1, lcolor(blue)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ") ytitle("Amount of Discrimination Against Blacks") ///
title("White Democrats") legend(off) name(discrim_B_byweekWD, replace) ///
xline(22, lcolor(red)) ylabel(.4(.1).8) 

twoway (bar discrim_B newweekofIW2 if pid3cat==0, fcolor(none)) ///
(lowess discrim_B newweekofIW2 if newweekofIW2<22 & pid3cat==0, lcolor(black)) ///
(lowess discrim_B newweekofIW2 if newweekofIW2>21 & pid3cat==0, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ") ytitle("Amount of Discrimination Against Blacks") ///
title("White Independents") legend(off) name(discrim_B_byweekWI, replace) ///
xline(22, lcolor(red)) ylabel(.4(.1).8) 


twoway (bar discrim_B newweekofIW2 if pid3cat==-1, fcolor(none)) ///
(lowess discrim_B newweekofIW2 if newweekofIW2<22 & pid3cat==-1, lcolor(red)) ///
(lowess discrim_B newweekofIW2 if newweekofIW2>21 & pid3cat==-1, lcolor(red)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ") ytitle("Amount of Discrimination Against Blacks") ///
title("White Republicans") legend(off) name(discrim_B_byweekWR, replace) ///
xline(22, lcolor(red)) ylabel(.4(.1).8) 
restore


*RELATIVE DISCRIMINATION AGAINST BLACKS VIZ WHITES
recode discrimination_whites (1=1 "a great deal")(2=.75)(3=.5)(4=.25)(5=0 "None at all")(else=.), gen(discrim_W)
gen discrim_BoverW=discrim_B-discrim_W

preserve
svyset [pw=weight]
collapse discrim_BoverW[pw=weight], by(newweekofIW2)
twoway (bar discrim_BoverW newweekofIW2, fcolor(white)) ///
(lowess discrim_BoverW newweekofIW2 if newweekofIW2<22, lcolor(black)) ///
(lowess discrim_BoverW newweekofIW2 if newweekofIW2>21, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ")  ytitle("Amount of Discrimination Against Blacks vs. Whites") title("Full Sample") ///
name(discrim_BoverW_byweek, replace) ///
legend(off) xline(22, lcolor(red)) ylabel(0(.1).6) 
restore

preserve
svyset [pw=weight]
collapse discrim_BoverW [pw=weight], by(newweekofIW2 BlackW)
twoway (bar discrim_BoverW newweekofIW2 if BlackW==1, fcolor(none)) ///
(lowess discrim_BoverW newweekofIW2 if newweekofIW2<22 & BlackW==1, lcolor(black)) ///
(lowess discrim_BoverW newweekofIW2 if newweekofIW2>21 & BlackW==1, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ")  ytitle("Amount of Discrimination Against Blacks vs. Whites") ///
title("Blacks") legend(off) name(discrim_BoverW_byweekB, replace) ///
xline(22, lcolor(red)) ylabel(0(.1).6) 

twoway (bar discrim_BoverW newweekofIW2 if BlackW==0, fcolor(none)) ///
(lowess discrim_BoverW newweekofIW2 if newweekofIW2<22 & BlackW==0, lcolor(black)) ///
(lowess discrim_BoverW newweekofIW2 if newweekofIW2>21 & BlackW==0, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ")  ytitle("Amount of Discrimination Against Blacks vs. Whites") ///
title("Whites") legend(off) name(discrim_BoverW_byweekW, replace) ///
xline(22, lcolor(red)) ylabel(0(.1).6) 
restore

preserve
svyset [pw=weight]
collapse discrim_BoverW [pw=weight] if White==1, by(newweekofIW2 pid3cat)
twoway (bar discrim_BoverW newweekofIW2 if pid3cat==1, fcolor(none)) ///
(lowess discrim_BoverW newweekofIW2 if newweekofIW2<22 & pid3cat==1, lcolor(blue)) ///
(lowess discrim_BoverW newweekofIW2 if newweekofIW2>21 & pid3cat==1, lcolor(blue)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ")  ytitle("Amount of Discrimination Against Blacks vs. Whites") ///
title("White Democrats") legend(off) name(discrim_BoverW_byweekWD, replace) ///
xline(22, lcolor(red)) ylabel(0(.1).6) 

twoway (bar discrim_BoverW newweekofIW2 if pid3cat==0, fcolor(none)) ///
(lowess discrim_BoverW newweekofIW2 if newweekofIW2<22 & pid3cat==0, lcolor(black)) ///
(lowess discrim_BoverW newweekofIW2 if newweekofIW2>21 & pid3cat==0, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ")  ytitle("Amount of Discrimination Against Blacks vs. Whites") ///
title("White Independents") legend(off) name(discrim_BoverW_byweekWI, replace) ///
xline(22, lcolor(red)) ylabel(0(.1).6) 


twoway (bar discrim_BoverW newweekofIW2 if pid3cat==-1, fcolor(none)) ///
(lowess discrim_BoverW newweekofIW2 if newweekofIW2<22 & pid3cat==-1, lcolor(red)) ///
(lowess discrim_BoverW newweekofIW2 if newweekofIW2>21 & pid3cat==-1, lcolor(red)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ")  ytitle("Amount of Discrimination Against Blacks vs. Whites") ///
title("White Republicans") legend(off) name(discrim_BoverW_byweekWR, replace) ///
xline(22, lcolor(red)) ylabel(0(.1).6) 
restore


*RACIAL RESENTMENT
recode racial_attitudes_tryhard (1=1)(2=.75)(3=.5)(4=.25)(5=0)(else=.), gen(resent1)
recode racial_attitudes_generations (1=0)(2=.25)(3=.5)(4=.75)(5=1)(else=.), gen(resent2)
alpha resent1 resent2
*alpha=.58
gen resent = (resent1+resent2)/2

preserve
svyset [pw=weight]
collapse resent [pw=weight], by(newweekofIW2)
twoway (bar resent newweekofIW2, fcolor(white)) ///
(lowess resent newweekofIW2 if newweekofIW2<22, lcolor(black)) ///
(lowess resent newweekofIW2 if newweekofIW2>21, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ")   ytitle("Racial Resentment") title("Full Sample") ///
legend(off) ylabel(.3(.1).8) xline(22, lcolor(red)) name(resent_byweek, replace)
restore

preserve
svyset [pw=weight]
collapse resent [pw=weight], by(newweekofIW2 BlackW)
twoway (bar resent newweekofIW2 if BlackW==1, fcolor(none)) ///
(lowess resent newweekofIW2 if newweekofIW2<22 & BlackW==1, lcolor(black)) ///
(lowess resent newweekofIW2 if newweekofIW2>21 & BlackW==1, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ")  ytitle("Racial Resentment") ///
title("Blacks") legend(off) name(resent_byweekB, replace) ///
xline(22, lcolor(red)) ylabel(.3(.1).8) 

twoway (bar resent newweekofIW2 if BlackW==0, fcolor(none)) ///
(lowess resent newweekofIW2 if newweekofIW2<22 & BlackW==0, lcolor(black)) ///
(lowess resent newweekofIW2 if newweekofIW2>21 & BlackW==0, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ")  ytitle("Racial Resentment") ///
title("Whites") legend(off) name(resent_byweekW, replace) ///
xline(22, lcolor(red)) ylabel(.3(.1).8) 
restore

preserve
svyset [pw=weight]
collapse resent [pw=weight] if White==1, by(newweekofIW2 pid3cat)
twoway (bar resent newweekofIW2 if pid3cat==1, fcolor(none)) ///
(lowess resent newweekofIW2 if newweekofIW2<22 & pid3cat==1, lcolor(blue)) ///
(lowess resent newweekofIW2 if newweekofIW2>21 & pid3cat==1, lcolor(blue)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ")  ytitle("Racial Resentment") ///
title("White Democrats") legend(off) name(resent_byweekWD, replace) ///
xline(22, lcolor(red)) ylabel(.3(.1).8) 

twoway (bar resent newweekofIW2 if pid3cat==0, fcolor(none)) ///
(lowess resent newweekofIW2 if newweekofIW2<22 & pid3cat==0, lcolor(black)) ///
(lowess resent newweekofIW2 if newweekofIW2>21 & pid3cat==0, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ")  ytitle("Racial Resentment") ///
title("White Independents") legend(off) name(resent_byweekWI, replace) ///
xline(22, lcolor(red)) ylabel(.3(.1).8) 


twoway (bar resent newweekofIW2 if pid3cat==-1, fcolor(none)) ///
(lowess resent newweekofIW2 if newweekofIW2<22 & pid3cat==-1, lcolor(red)) ///
(lowess resent newweekofIW2 if newweekofIW2>21 & pid3cat==-1, lcolor(red)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ")  ytitle("Racial Resentment") ///
title("White Republicans") legend(off) name(resent_byweekWR, replace) ///
xline(22, lcolor(red)) ylabel(.3(.1).8) 
restore


*OLD-FASHIONED RACISM
recode racial_attitudes_marry (1=1)(2=.75)(3=.5)(4=.25)(5=0)(else=.), gen(ofr1)
recode racial_attitudes_date (1=0)(2=.25)(3=.5)(4=.75)(5=1)(else=.), gen(ofr2)
alpha ofr1 ofr2
*alpha=.59
gen ofr = (ofr1+ofr2)/2

preserve
svyset [pw=weight]
collapse ofr[pw=weight], by(newweekofIW2)
twoway (bar ofr newweekofIW2, fcolor(white)) ///
(lowess ofr newweekofIW2 if newweekofIW2<22, lcolor(black)) ///
(lowess ofr newweekofIW2 if newweekofIW2>21, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ") ytitle("Old-Fashioned Racism") title("Full Sample") ///
legend(off) ylabel(0(.1).6) xline(22, lcolor(red)) name(ofr_byweek, replace)
restore

preserve
svyset [pw=weight]
collapse ofr [pw=weight], by(newweekofIW2 BlackW)
twoway (bar ofr newweekofIW2 if BlackW==1, fcolor(none)) ///
(lowess ofr newweekofIW2 if newweekofIW2<22 & BlackW==1, lcolor(black)) ///
(lowess ofr newweekofIW2 if newweekofIW2>21 & BlackW==1, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ") ytitle("Old-Fashioned Racism") ///
title("Blacks") legend(off) name(ofr_byweekB, replace) ///
xline(22, lcolor(red)) ylabel(0(.1).6) 

twoway (bar ofr newweekofIW2 if BlackW==0, fcolor(none)) ///
(lowess ofr newweekofIW2 if newweekofIW2<22 & BlackW==0, lcolor(black)) ///
(lowess ofr newweekofIW2 if newweekofIW2>21 & BlackW==0, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ")  ytitle("Old-Fashioned Racism") ///
title("Whites") legend(off) name(ofr_byweekW, replace) ///
xline(22, lcolor(red)) ylabel(0(.1).6) 
restore

preserve
svyset [pw=weight]
collapse ofr [pw=weight] if White==1, by(newweekofIW2 pid3cat)
twoway (bar ofr newweekofIW2 if pid3cat==1, fcolor(none)) ///
(lowess ofr newweekofIW2 if newweekofIW2<22 & pid3cat==1, lcolor(blue)) ///
(lowess ofr newweekofIW2 if newweekofIW2>21 & pid3cat==1, lcolor(blue)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ")  ytitle("Old-Fashioned Racism") ///
title("White Democrats") legend(off) name(ofr_byweekWD, replace) ///
xline(22, lcolor(red)) ylabel(0(.1).6) 

twoway (bar ofr newweekofIW2 if pid3cat==0, fcolor(none)) ///
(lowess ofr newweekofIW2 if newweekofIW2<22 & pid3cat==0, lcolor(black)) ///
(lowess ofr newweekofIW2 if newweekofIW2>21 & pid3cat==0, lcolor(black)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ") ytitle("Old-Fashioned Racism") ///
title("White Independents") legend(off) name(ofr_byweekWI, replace) ///
xline(22, lcolor(red)) ylabel(0(.1).6) 


twoway (bar ofr newweekofIW2 if pid3cat==-1, fcolor(none)) ///
(lowess ofr newweekofIW2 if newweekofIW2<22 & pid3cat==-1, lcolor(red)) ///
(lowess ofr newweekofIW2 if newweekofIW2>21 & pid3cat==-1, lcolor(red)) , ///
xlabel(2 "Jan" 6"Feb" 10"Mar" 15 "Apr" 19 "May" 23 "Jun" 28 "Jul" 32 "Aug" 36"Sept" 41 "Oct" 45 "Nov" 49 "Dec", labsize(small)) xtitle(" ") ytitle("Old-Fashioned Racism") ///
title("White Republicans") legend(off) name(ofr_byweekWR, replace) ///
xline(22, lcolor(red)) ylabel(0(.1).6) 
restore

*STATISTICAL TESTS FOR ALTERNATIVE RACIAL ATTITUDE MEASURES
svyset [pw=weight]
svy: reg discrim_B prepost
est store prepost
svy: reg discrim_B week22-week52
est store postweekly
est table prepost postweekly, b(%9.2f) star(.1 .05 .01) stats(N)
coefplot prepost postweekly, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("Full Sample") name(discrim_B_full_temporal, replace)  ylabel(, labsize(vsmall)) 

//by racial group
svyset [pw=weight]
svy, subpop(White): reg discrim_B prepost
est store prepostW
svy, subpop(White): reg discrim_B week22-week52
est store postweeklyW
svy, subpop(Black): reg discrim_B prepost
est store prepostB
svy, subpop(Black): reg discrim_B week22-week52
est store postweeklyB
est table prepostW postweeklyW prepostB postweeklyB,  b(%9.2f) star(.1 .05 .01) stats(N) style(col) 
coefplot prepostW postweeklyW, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") ylabel(, labsize(vsmall)) title("Whites") name(discrim_B_W_temporal, replace)
coefplot prepostB postweeklyB, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") ylabel(, labsize(vsmall)) title("Blacks") name(discrim_B_B_temporal, replace)
suest postweeklyW postweeklyB
test [postweeklyW]week23=[postweeklyB]week23

suest prepostW prepostB
test [prepostW]prepost=[prepostB]prepost

//by party among Whites
svy, subpop(WDem): reg discrim_B prepost
est store prepostWD
svy, subpop(WDem): reg discrim_B week22-week52
est store postweeklyWD
svy, subpop(WInd): reg discrim_B prepost
est store prepostWI
svy, subpop(WInd): reg discrim_B week22-week52
est store postweeklyWI
svy, subpop(WGOP): reg discrim_B prepost
est store prepostWR
svy, subpop(WGOP): reg discrim_B week22-week52
est store postweeklyWR
est table prepostWD postweeklyWD prepostWI postweeklyWI prepostWR postweeklyWR, b(%9.2f) star(.1 .05 .01) stats(N) style(col)
coefplot prepostWD postweeklyWD , xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Democrats") name(discrim_B_WD_temporal, replace)  ylabel(, labsize(vsmall))
coefplot prepostWI postweeklyWI, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Independents") name(discrim_B_WI_temporal, replace)  ylabel(, labsize(vsmall))
coefplot prepostWR postweeklyWR, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Republicans") name(discrim_B_WR_temporal, replace)  ylabel(, labsize(vsmall))

*DISCRIMINATION: BLACKS VS. WHITES
svyset [pw=weight]
svy: reg discrim_BoverW prepost
est store prepost
svy: reg discrim_BoverW week22-week52
est store postweekly
est table prepost postweekly, b(%9.2f) star(.1 .05 .01) stats(N)
coefplot prepost postweekly, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("Full Sample") name(discrim_BW_full_temporal, replace)  ylabel(, labsize(vsmall)) 

//by racial group
svyset [pw=weight]
svy, subpop(White): reg discrim_BoverW prepost
est store prepostW
svy, subpop(White): reg discrim_BoverW week22-week52
est store postweeklyW
svy, subpop(Black): reg discrim_BoverW prepost
est store prepostB
svy, subpop(Black): reg discrim_BoverW week22-week52
est store postweeklyB
est table prepostW postweeklyW prepostB postweeklyB,  b(%9.2f) star(.1 .05 .01) stats(N) style(col) 
coefplot prepostW postweeklyW, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") ylabel(, labsize(vsmall)) title("Whites") name(discrim_BW_W_temporal, replace)
coefplot prepostB postweeklyB, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") ylabel(, labsize(vsmall)) title("Blacks") name(discrim_BW_B_temporal, replace)
suest postweeklyW postweeklyB
test [postweeklyW]week23=[postweeklyB]week23

suest prepostW prepostB
test [prepostW]prepost=[prepostB]prepost

//by party among Whites
svy, subpop(WDem): reg discrim_BoverW prepost
est store prepostWD
svy, subpop(WDem): reg discrim_BoverW week22-week52
est store postweeklyWD
svy, subpop(WInd): reg discrim_BoverW prepost
est store prepostWI
svy, subpop(WInd): reg discrim_BoverW week22-week52
est store postweeklyWI
svy, subpop(WGOP): reg discrim_BoverW prepost
est store prepostWR
svy, subpop(WGOP): reg discrim_BoverW week22-week52
est store postweeklyWR
est table prepostWD postweeklyWD prepostWI postweeklyWI prepostWR postweeklyWR, b(%9.2f) star(.1 .05 .01) stats(N) style(col)
coefplot prepostWD postweeklyWD , xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Democrats") name(discrim_BW_WD_temporal, replace)  ylabel(, labsize(vsmall))
coefplot prepostWI postweeklyWI, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Independents") name(discrim_BW_WI_temporal, replace)  ylabel(, labsize(vsmall))
coefplot prepostWR postweeklyWR, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Republicans") name(discrim_BW_WR_temporal, replace)  ylabel(, labsize(vsmall))

*RESENTMENT
svyset [pw=weight]
svy: reg resent prepost
est store prepost
svy: reg resent week22-week52
est store postweekly
est table prepost postweekly, b(%9.2f) star(.1 .05 .01) stats(N)
coefplot prepost postweekly, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("Full Sample") name(resent_full_temporal, replace)  ylabel(, labsize(vsmall)) 

//by racial group
svyset [pw=weight]
svy, subpop(White): reg resent prepost
est store prepostW
svy, subpop(White): reg resent week22-week52
est store postweeklyW
svy, subpop(Black): reg resent prepost
est store prepostB
svy, subpop(Black): reg resent week22-week52
est store postweeklyB
est table prepostW postweeklyW prepostB postweeklyB,  b(%9.2f) star(.1 .05 .01) stats(N) style(col) 
coefplot prepostW postweeklyW, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") ylabel(, labsize(vsmall)) title("Whites") name(resent_W_temporal, replace)
coefplot prepostB postweeklyB, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") ylabel(, labsize(vsmall)) title("Blacks") name(resent_B_temporal, replace)
suest postweeklyW postweeklyB
test [postweeklyW]week23=[postweeklyB]week23

suest prepostW prepostB
test [prepostW]prepost=[prepostB]prepost

//by party among Whites
svy, subpop(WDem): reg resent prepost
est store prepostWD
svy, subpop(WDem): reg resent week22-week52
est store postweeklyWD
svy, subpop(WInd): reg resent prepost
est store prepostWI
svy, subpop(WInd): reg resent week22-week52
est store postweeklyWI
svy, subpop(WGOP): reg resent prepost
est store prepostWR
svy, subpop(WGOP): reg resent week22-week52
est store postweeklyWR
est table prepostWD postweeklyWD prepostWI postweeklyWI prepostWR postweeklyWR, b(%9.2f) star(.1 .05 .01) stats(N) style(col)
coefplot prepostWD postweeklyWD , xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Democrats") name(resent_WD_temporal, replace)  ylabel(, labsize(vsmall))
coefplot prepostWI postweeklyWI, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Independents") name(resent_WI_temporal, replace)  ylabel(, labsize(vsmall))
coefplot prepostWR postweeklyWR, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Republicans") name(resent_WR_temporal, replace)  ylabel(, labsize(vsmall))

*OLD-FASHIONED RACISM
svyset [pw=weight]
svy: reg ofr prepost
est store prepost
svy: reg ofr week22-week52
est store postweekly
est table prepost postweekly, b(%9.2f) star(.1 .05 .01) stats(N)
coefplot prepost postweekly, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("Full Sample") name(ofr_full_temporal, replace)  ylabel(, labsize(vsmall)) 

//by racial group
svyset [pw=weight]
svy, subpop(White): reg ofr prepost
est store prepostW
svy, subpop(White): reg ofr week22-week52
est store postweeklyW
svy, subpop(Black): reg ofr prepost
est store prepostB
svy, subpop(Black): reg ofr week22-week52
est store postweeklyB
est table prepostW postweeklyW prepostB postweeklyB,  b(%9.2f) star(.1 .05 .01) stats(N) style(col) 
coefplot prepostW postweeklyW, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") ylabel(, labsize(vsmall)) title("Whites") name(ofr_W_temporal, replace)
coefplot prepostB postweeklyB, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") ylabel(, labsize(vsmall)) title("Blacks") name(ofr_B_temporal, replace)
suest postweeklyW postweeklyB
test [postweeklyW]week23=[postweeklyB]week23

suest prepostW prepostB
test [prepostW]prepost=[prepostB]prepost

//by party among Whites
svy, subpop(WDem): reg ofr prepost
est store prepostWD
svy, subpop(WDem): reg ofr week22-week52
est store postweeklyWD
svy, subpop(WInd): reg ofr prepost
est store prepostWI
svy, subpop(WInd): reg ofr week22-week52
est store postweeklyWI
svy, subpop(WGOP): reg ofr prepost
est store prepostWR
svy, subpop(WGOP): reg ofr week22-week52
est store postweeklyWR
est table prepostWD postweeklyWD prepostWI postweeklyWI prepostWR postweeklyWR, b(%9.2f) star(.1 .05 .01) stats(N) style(col)
coefplot prepostWD postweeklyWD , xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Democrats") name(ofr_WD_temporal, replace)  ylabel(, labsize(vsmall))
coefplot prepostWI postweeklyWI, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Independents") name(ofr_WI_temporal, replace)  ylabel(, labsize(vsmall))
coefplot prepostWR postweeklyWR, xline(0, lcolor(red)) keep(prepost week*) plotlabels("Pre-Post" "Weekly Indicators") title("White Republicans") name(ofr_WR_temporal, replace)  ylabel(, labsize(vsmall))


/*APPENDIX FIGURE A9*/
graph combine discrim_B_byweek discrim_B_byweekW discrim_B_byweekB discrim_B_byweekWR discrim_B_byweekWI discrim_B_byweekWD , ycommon common note("Lowess smoothing. Nationscape 2020") row(2) altshrink 
graph export FigA9.tif, replace

/*APPENDIX FIGURE A10*/
graph combine discrim_B_full_temporal discrim_B_W_temporal discrim_B_B_temporal discrim_B_WR_temporal discrim_B_WI_temporal discrim_B_WD_temporal, ycommon common row(2) altshrink xcommon
graph export FigA10.tif, replace 

/*APPENDIX FIGURE A11*/
graph combine discrim_BoverW_byweek discrim_BoverW_byweekW discrim_BoverW_byweekB discrim_BoverW_byweekWR discrim_BoverW_byweekWI discrim_BoverW_byweekWD , ycommon common note("Lowess smoothing. Nationscape 2020") row(2) altshrink 
graph export FigA11.tif, replace 

/*APPENDIX FIGURE A12*/
graph combine discrim_BW_full_temporal discrim_BW_W_temporal discrim_BW_B_temporal discrim_BW_WR_temporal discrim_BW_WI_temporal discrim_BW_WD_temporal , ycommon common row(2) altshrink xcommon
graph export FigA12.tif, replace 

/*APPENDIX FIGURE A13*/
graph combine resent_byweek resent_byweekW resent_byweekB resent_byweekWR resent_byweekWI resent_byweekWD , ycommon common note("Lowess smoothing. Nationscape 2020") row(2) altshrink 
graph export FigA13.tif, replace 

/*APPENDIX FIGURE A14*/
graph combine resent_full_temporal resent_W_temporal resent_B_temporal resent_WR_temporal resent_WI_temporal resent_WD_temporal , ycommon common row(2) altshrink xcommon
graph export FigA14.tif, replace 

/*APPENDIX FIGURE A15*/
graph combine ofr_byweek ofr_byweekW ofr_byweekB ofr_byweekWR ofr_byweekWI ofr_byweekWD , ycommon common note("Lowess smoothing. Nationscape 2020") row(2) altshrink 
graph export FigA15.tif, replace 

/*APPENDIX FIGURE A16*/
graph combine ofr_full_temporal ofr_W_temporal ofr_B_temporal ofr_WR_temporal ofr_WI_temporal ofr_WD_temporal , ycommon common row(2) altshrink xcommon
graph export FigA16.tif, replace 

log close
